a11y: Fix warnings when removing widgets that don't have accessibles
authorBenjamin Otte <otte@redhat.com>
Sat, 9 Jul 2011 19:20:39 +0000 (21:20 +0200)
committerBenjamin Otte <otte@redhat.com>
Sat, 9 Jul 2011 19:24:09 +0000 (21:24 +0200)
The remove handler would not check that removed widgets do indeed have
an accessible associated with them and would happily run all the removal
code with a NULL object. Not good.

gtk/a11y/gtkcontaineraccessible.c

index f02020db105c908502ff515c14a24ecf48731e03..844fe841e16d7c19b2110fd787f67c8b91797f64 100644 (file)
@@ -142,6 +142,8 @@ gtk_container_accessible_real_remove_gtk (GtkContainer *container,
 
   atk_parent = ATK_OBJECT (data);
   atk_child = gtk_widget_get_accessible (widget);
+  if (atk_child == NULL)
+    return 1;
   accessible = GTK_CONTAINER_ACCESSIBLE (atk_parent);
 
   g_object_notify (G_OBJECT (atk_child), "accessible_parent");